#include<sys/types.h>
#include<pthread.h>

#include"list.h"

typedef struct blockingqueue{
    list_node queue;
    int is_empty;
    pthread_mutex_t mutex;
    pthread_cond_t cond;

}blockingqueue;

//创建一个新的阻塞队列
extern blockingqueue* create_blockingqueue();

//阻塞出队
extern void* bq_poll(blockingqueue* );

//当timeout 设置为0时为非阻塞出队
extern void* bq_ub_poll(blockingqueue* ,u_int32_t timeout);

//非阻塞入队
extern void bq_push(blockingqueue* ,void* );

//释放队列空间
extern void destory_bk_queue(blockingqueue*);